import { Module } from '@nestjs/common'
import { CartController } from './cart.controller'
import { CartService } from './cart.service'
import { Cart } from '../entities/cart.entity'
import { TypeOrmModule } from '@nestjs/typeorm'
import { JwtModule } from '@nestjs/jwt'
import { JwtConstant } from '../constant'
import { Goods } from '../entities/goods.entity'

@Module({
  controllers: [CartController],
  providers: [CartService],
  imports: [
    JwtModule.register({
      secret: JwtConstant.SECRET, // 密钥
      signOptions: {
        expiresIn: JwtConstant.EXPIRES_IN, // 有效期
      },
    }),
    TypeOrmModule.forFeature([Cart, Goods]),
  ],
})
export class CartModule {}
